<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="{%$URL%}style/webstyle.css" rel="stylesheet" type="text/css" />
<title>{%$web_name%}</title>

</head>
<link href="{%$URL%}mx.ico" rel="shortcut icon"/>
<script src="{%$URL%}jquery-1.7.1.min.js"></script>
<script src="{%$URL%}defalut.js"></script>
<script type="text/javascript">
//登录检测用户名
function checkname(){
  var user = $('#lc_user').val();
  if(user){
    $.post("index.php?a=user_name_ajax",{lc_user:user,action:"1"}, function(data){
      $('#namen').html(data);
      });
  }
}
//验证密码和确认密码
function check_psw(){
  var psw = $("#lc_password").val();
  var psw2 = $("#lc_password2").val();
  if(psw){
    if(psw!==psw2){
      $("#edit_psw2").text("亲，两次输入的密码不相同！");
    }else{
      $("#edit_psw2").text("亲，输入正确！");
      }
    }
  }
//检查用户名个人信息修改
function check_edit_sub(){
  var psw = $("#lc_password").val();
  var psw2 = $("#lc_password2").val();
  if(psw!==psw2){
    $("#edit_psw2").text("亲，两次输入的密码不相同！");
    return false;
    }
  }
//验证码更换
function newgdcode(obj,url) {
  obj.src = url+ '&nowtime=' + new Date().getTime();//后面传递一个随机参数，否则在IE7和火狐下，不刷新图片
}
//检查登录数据
function check_login(){
  var user = $("#lc_user").val();//用户名
  var psw = $("#password").val();//密码
  var yzm = $("#yzm").val();//验证码
  if(!user){
    msg_tips("亲，用户名不能为空！","")
    return false;
    }
  if(!psw){
    msg_tips("亲，密码不能为空！","")
    return false;
    }
  if(!yzm){
    msg_tips("亲，验证码不能为空！","")
    return false;
    }
  }
</script>
<body>
  <!--头部 开始-->
{%include file='head.htm'%}
<!--头部 结束--> 
<!--内容 开始-->
<div class="nr" style="padding:0 0 40px 0;">
  <div class="main_title"> <span class="main_t">会员信息</span><br>
    <!-- Wonderful Case  --></div>
  <div style="padding:40px 0 0 0;">
    <div class="main_l">
      <div class="main_l_title"><span style="font-size:22px;">栏目分类</span><br>
        <!-- Wonderful case --></div>
      <div class="main_l_list">
        <ul>
          <li><a href="index.php?p=user">会员信息</a></li>
          <li><a href="index.php?p=shoppingcart_list">购物车</a></li>
          <li><a href="index.php?p=dingdan_list">订单管理</a></li>
          <li><a href="index.php?p=user_zt">高级会员</a></li>
          <li><a href="index.php?a=user_exit">退出会员</a></li>
        </ul>
      </div>
    </div>
    <div class="main_r">
      <div class="main_ly">
        {%if $smarty.session.user_id%}
        {%lcmx_user_show set="列表名:usershow,登录页:index.php?p=user"%}
        会员用户名：{%$usershow.lc_title%}
        <form action="index.php?a=user_edit" method="post" onSubmit="return check_edit_sub()">
      <ul style="margin-top:10px;">
          <li>
            <div class="main_ly_t1">用户名：</div>
            {%$usershow.lc_title%}
            <div class="cl"></div>
          </li>
          <li>
            <div class="main_ly_t1">姓名：</div>
            <input type="text" name="lc_name" value="{%$usershow.lc_name%}" class="main_bd">
            <div class="cl"></div>
          </li>
          <li>
            <div class="main_ly_t1">密码：</div>
            <input type="text" type="password" name="lc_password" id="lc_password" class="main_bd">&nbsp;&nbsp;不填写，为原密码
            <div class="cl"></div>
          </li>
          <li>
            <div class="main_ly_t1">确认密码:</div>
            <input type="password" name="lc_password2" id="lc_password2" onBlur="check_psw()" class="main_bd">
            <div class="cl"></div>
          </li>
          <li>
            <div class="main_ly_t1">电话：</div>
            <input type="text" name="lc_tel" value="{%$usershow.lc_tel%}" class="main_bd">
            <div class="cl"></div>
          </li>
          <li>
            <div class="main_ly_t1">邮箱：</div>
            <input type="text" name="lc_email" value="{%$usershow.lc_email%}" class="main_bd">&nbsp;&nbsp;{%if $usershow.lc_email ==""%}建议保存邮箱，便于帐号找回密码{%/if%}
            <div class="cl"></div>
          </li>
          <li>
            <div class="main_ly_t1">会员类型:</div>
            {%$usershow.type%}
            <div class="cl"></div>
          </li>

          <li>
              <input type="submit" id="chongzhi" style="margin-left:30px; height:35px; width:100px; border:0px; font-size:16px; background:#487CE1; color:#FFF;" value="修改" />
            </li>
          </ul>
        </form>
        {%else%}
        <form action="index.php?a=user_login" method="post" onSubmit="return check_login()">
          <ul id="user_dl">
          <li>
            <div class="main_ly_t1">账&nbsp;&nbsp;号</div>
            <input type="text" name="lc_user" required id="lc_user" onBlur="checkname()" class="main_bd">&nbsp;&nbsp;<span id="namen"></span>
            <div class="cl"></div>
          </li>
          <li>
            <div class="main_ly_t1">密&nbsp;&nbsp;码：</div>
            <input name="lc_password" type="password" required id="password" class="main_bd">&nbsp;&nbsp;<span id="pass"></span>
            <div class="cl"></div>
          </li>
          <li>
            <div class="main_ly_t1">验证码：</div>
            <input type="text" name="yzm" id="yzm" class="main_bd2">&nbsp;&nbsp;<img src="index.php?a=imagecode" alt="看不清楚，换一张" title="看不清楚，换一张" align="absmiddle" style="cursor:pointer;margin-bottom:3px;" onClick="newgdcode(this,this.src)"> <span id="Ryzm"></span> 
            <div class="cl"></div>
          </li>
          <li style="height:40px;">
              <input type="submit" style="height:35px; width:100px; border:0px; font-size:16px; background:#487CE1; color:#FFF;"value="登  陆">
              &nbsp;&nbsp;<a href="index.php?p=user_reg">注册</a>
              &nbsp;&nbsp;<a href="index.php?p=user_findpassword">找回密码</a></li>
          </ul>
        </form>
        {%/if%}</div>
</div>
</div>
    <!-- right -->
    <div class="clear"></div>
  </div>
  {%include file="bot.htm"%}</div>
<!-- body --> 
<br>
<br>
</body>
</html>
